﻿using System;
using System.Xml.Serialization;

namespace RssToolkit.Rss
{
    /// <summary>
    ///  <yt:statistics favoriteCount='3540' viewCount='1589955'/>
    /// </summary>
    [Serializable]
    [XmlRoot("statistics", Namespace = "http://gdata.youtube.com/schemas/2007")]
    public class YouTubeStatistics
    {
        [XmlAttribute("favoriteCount", Namespace = "http://gdata.youtube.com/schemas/2007")]
        public int favoriteCount;

        [XmlAttribute("viewCount", Namespace = "http://gdata.youtube.com/schemas/2007")]
        public int viewCount;

        /// <summary>
        /// Количество комментариев
        /// </summary>
        public int commentCount;

        /// <summary>
        /// Суммарное число просмотров
        /// </summary>
        //[XmlAttribute("totalUploadViews", Namespace = "http://gdata.youtube.com/schemas/2007")]
        [XmlIgnore] public ulong totalUploadViews;

        /// <summary>
        /// Число подписчиков
        /// </summary>
        //[XmlAttribute("subscriberCount", Namespace = "http://gdata.youtube.com/schemas/2007")]
        [XmlIgnore] public uint subscriberCount;

        /// <summary>
        /// Обязательное поле для API v3
        /// </summary>
        [XmlIgnore]
        public string ID;

        [XmlIgnore] public string Username;

        [XmlIgnore] public string Name;

        [XmlIgnore] public string About;

        [XmlIgnore] public string Gender;

        [XmlIgnore] public string Location;

        /// <summary>
        /// Количество загруженных видео
        /// </summary>
        [XmlIgnore] public int Uploads;

        /// <summary>
        /// Идентификатор плейлиста с видео
        /// </summary>
        [XmlIgnore]
        public string UploadsPlayListID;
    }

    [Serializable]
    [XmlRoot("group", Namespace = "http://search.yahoo.com/mrss/")]
    public class YouTubeGroup
    {

        /// <summary>
        /// Описание видео
        /// </summary>
        [XmlElement("description", Namespace = "http://search.yahoo.com/mrss/")]
        public string Description
        {
            get; set;
        }

        /// <summary>
        /// Описание видео
        /// </summary>
        [XmlElement("keywords", Namespace = "http://search.yahoo.com/mrss/")]
        public string Keywords
        {
            get;
            set;
        }

        /// <summary>
        /// Заголовок видео
        /// </summary>
        [XmlElement("title", Namespace = "http://search.yahoo.com/mrss/")]
        public string Title
        {
            get;
            set;
        }

        /// <summary>
        /// </summary>
        [XmlElement("category", Namespace = "http://search.yahoo.com/mrss/")]
        public string[] Category
        {
            get;
            set;
        }


        /// <summary>
        /// </summary>
        [XmlElement("content", Namespace = "http://search.yahoo.com/mrss/")]
        public string[] MContent
        {
            get;
            set;
        }
    }
}
